package com.run.cat.service.impl;

import com.run.cat.common.base.BaseServiceImpl;
import com.run.cat.common.util.EmptyUtil;
import com.run.cat.common.util.RequestUtil;
import com.run.cat.dao.entity.User;
import com.run.cat.dao.mapper.UserMapper;
import com.run.cat.service.IUserService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户信息表 服务实现类
 * </p>
 *
 * @author CG
 * @since 2020-08-19
 */
@Service
public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implements IUserService {

    @Override
    public User getUser() {
        Long loginId = RequestUtil.getLoginId();
        if(EmptyUtil.isEmpty(loginId))  return null;
        return queryOne(new User().setRegisterId(loginId));
    }
}
